how to write integration test